package org.llc.client1.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

/**
 * 测试控制器
 *
 * @author llc
 * @date 2020/1/10 22:37
 * @since 1.0.0
 */
@RestController
public class IndexController {

    @GetMapping("/")
    public String main() {
        return "Welcome to the main!";
    }

    @GetMapping("/index")
    public String index() {
        return "Welcome to the index!";
    }

    @GetMapping("/user")
    public Principal principal(Principal user) {
        return user;
    }

    @GetMapping("/user/test")
    public ResponseEntity test(){
        return ResponseEntity.ok("get auth resource");
    }


}
